#! /bin/bash
myDir=/usr/share/nginx/html/db/
if [ ! -x $myDir ]; then
 mkdir $myDir
fi
if [ ! -d $myDir ]; then
 mkdir $myDir;
else
 find $myDir -atime +3 -type f -name *gz -exec rm -f {} \;
fi
mysqldump -cp --user=root --password="JJyg@1209" jiajiayigou | gzip > "$myDir"jiajiayigou-`date +%Y%m%d%H`.sql.gz;
